package com.docking.heylo.web.utils;


import com.docking.heylo.web.vo.BaseVo;

public class ResultUtil {

    public static BaseVo success(String message){
        return success(message,null);
    }

    public static BaseVo success(String message,Object data){
        return vo(1,message,data);
    }

    public static BaseVo error(int code, String message) {
        return error(code,message,null);
    }

    public static BaseVo error(int code, String message, Object data) {
        return vo(code,message,data);
    }

    private static BaseVo vo(int code, String message, Object data){
        BaseVo bv = new BaseVo();
        bv.setCode(code);
        bv.setMsg(message);
        bv.setData(data);
        return bv;
    }


}
